<?php

interface ClassStructure_Exception {
}
 
/**
 * This exception is thrown when __call() does not map to a valid method
 */
class ClassStructure_Exception_PropertyDoesNotExist extends Exception implements ClassStructure_Exception {
	
	/**
	 * @access public
	 * @param string $str_method The method name which does not exist.
	 */  
	public function __construct($str_method, $mix_class) {
        $str_class = get_class($mix_class);
		parent::__construct('The property [' . $str_method . '] does not exist within the object of class [' . $str_class . '].');
	}
	
}

/**
 * This exception is thrown when __call() does not map to a valid method
 */
class ClassStructure_Exception_MethodDoesNotExist extends Exception implements ClassStructure_Exception {
	
	/**
	 * @access public
	 * @param string $str_method The method name which does not exist.
	 */  
	public function __construct($str_method, $mix_class) {
        $str_class = get_class($mix_class);
		parent::__construct('The method [' . $str_method . '] was invoked, but was not found within the object\'s [' . $str_class . '] publicly available methods.');
	}
	
}

/**
 * This exception is thrown when trying to add a callback which is not valid
 */
class ClassStructure_Exception_CallbackInvalid extends Exception implements ClassStructure_Exception {
	
	/**
	 * @access public
	 * @param callback $clb_callable The callback which is invalid.
	 */  
	public function __construct($clb_callable) {
		
        $str_callback = null;
        if(is_string($clb_callable)) {
            $str_callback = (string) $clb_callable;
        } else if(is_array($clb_callable)) {
            $str_callback = (string) $clb_callable[0] . '::' . (string) $clb_callable[1];
        } else {
            $str_callback = '(invalid callback type)';
        }
        
        parent::__construct('The callback [' . $clb_callable . '] is invalid because it does not reference a function or method.');
	}
	
}

/**
 * This exception is thrown when added a specific callback as a layer, however,
 * the method signature does not match.
 */
class ClassStructure_Exception_InvalidMethodBinding extends Exception implements ClassStructure_Exception {
}

class ClassStructure_Exception_InvalidMixinDefinition extends Exception implements ClassStructure_Exception {
}

class ClassStructure_Exception_RegisteredMixinDoesNotExist extends Exception implements ClassStructure_Exception {
}

class ClassStructure_Exception_ClassDoesNotExist extends Exception implements ClassStructure_Exception {
}

?>
